
import { Column, Table } from 'sequelize-typescript';
import { BaseModel } from '@/model'
import { DataTypes } from "sequelize";

@Table
export class User extends BaseModel {
	@Column({ type: DataTypes.INTEGER, autoIncrement: true, primaryKey: true, comment: '用户id' })
	userId: number;

	@Column({ allowNull: false, comment: "姓名" })
	username: string;

	@Column({ allowNull: false, comment: "密码" })
	password: string;

	@Column({ type: DataTypes.INTEGER, allowNull: false, defaultValue: 0, comment: "用户状态" })
	userValid: number;

	@Column({ type: DataTypes.INTEGER, comment: "是否启用" })
	status: number;

	@Column({ allowNull: false, defaultValue: 1, comment: "性别" })
	userSex: number;

	@Column({ type: DataTypes.INTEGER, allowNull: false, comment: "所属部门" })
	deptId: number;

	@Column({ allowNull: false, comment: "手机号" })
	phone: string;

	@Column({ allowNull: false, comment: "工号" })
	userCode: string;

	@Column({ type: DataTypes.INTEGER, comment: "排序" })
	userSort: number;

	@Column({ comment: "所属角色" })
	role: string;

	@Column({ comment: "头像" })
	avatar: string;

	@Column({ comment: "用户名" })
	name: string;

	@Column({ comment: "头衔" })
	userTitle: string;

	@Column({ comment: "职位" })
	userPos: string;

	@Column({ comment: "兼职部门" })
	deptIds: string;

	@Column({ comment: "电子签名" })
	signaturePic: string;

	@Column({ comment: "办公电话" })
	officePhone: string;

	@Column({ comment: "绑定ip" })
	bindIp: string;

	@Column({ comment: "昵称" })
	nickname: string;

	@Column({ comment: "邮箱" })
	email: string;

	@Column({ comment: "钉钉openid" })
	ddOpenid: string;

	@Column({ comment: "微信openid" })
	wxOpenid: string;

	@Column({ comment: "生日" })
	birthday: string;

	@Column({ comment: "qq openid" })
	qqOpenid: string;

	@Column({ comment: "备注" })
	remark: string;

	@Column({ comment: "创建人" })
	createBy: string;

	@Column({ type: DataTypes.TEXT, comment: "刷新token" })
	refresh_token: string;

}
